#include "progressBar.h"
typedef void (*callback_t)(int);

void downLoad(callback_t ct)
{
  int total = 1000;
  int cur = 0;
  while(cur <= total)
  {
	usleep(50 * 1000);
	int rate = (cur * 100) / total;
	ct(rate);
	cur += 10;
  }
  printf("\n");
}


int main()
{
  printf("downLoad--1\n");
  downLoad(process_bar);
  initbar();
  printf("downLoad--2\n");
  downLoad(process_bar);
  initbar();
  printf("downLoad--3\n");
  downLoad(process_bar);
  initbar();
  printf("downLoad--4\n");
  downLoad(process_bar);
  initbar();

  return 0;
}
